'use strict';

const router = app => {
	const {
		router,
		controller: {
			home,
			user,
			dictionary
		}
	} = app;

	router.get('/api/user', user.get);
	router.get('/api/user/list', user.list);

	router.get('/api/dictionary/nodes', dictionary.roots);
	router.get('/api/dictionary/nodes/:id', dictionary.nodes);
	
	router.post('/api/login', home.login);
	router.get('/api/loguser', home.loguser);
	router.post('/api/logout', home.logout);
	// router.all('/api/*', home.proxy);
	router.get('*', home.index);
}
module.exports = router;